package com.hauwei.huaweishop.service.impl;

import com.hauwei.huaweishop.dao.OrdersDao;
import com.hauwei.huaweishop.entity.Orders;
import com.hauwei.huaweishop.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersDao ordersDao;
    @Override
    public void addOrders(Orders orders) {
        ordersDao.addOrders(orders);
    }

    @Override
    public void deleteOrdersByOid(Integer oid) {
        ordersDao.deleteOrdersByOid(oid);
    }

    @Override
    public void updateOrders(Orders orders) {
        ordersDao.updateOrders(orders);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public List<Orders> queryOrdersList() {
        return ordersDao.queryOrdersList();
    }

    @Override
    public Orders queryByOid(Integer oid) {
        return ordersDao.queryByOid(oid);
    }
}
